package com.apes.fa.service;

import com.apes.fa.model.FaAssetScrap;
import com.apes.fa.model.FaAssetScrapItem;
import com.apes.fa.model.FaCard;
import com.apes.fa.respository.FaAssetScrapItemRepository;
import com.apes.fa.respository.FaAssetScrapRepository;
import com.apes.fa.respository.FaCardRepository;
import com.apes.framework.api.DomainService;
import com.apes.framework.jpa.spec.JpaDsl;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Optional;

/**
 * @BelongsProject: apes-server
 * @BelongsPackage: com.apes.fa.service
 * @ClassName: FaAssetScrapService
 * @Author: PengZiFeng
 * @Description: 资产报废毁损
 * @CreateTime: 2021-09-22 11:45
 * @Version: 1.0
 */
@Service("faAssetScrapItemService")
public class FaAssetScrapItemService extends DomainService {

    @Autowired
    private FaAssetScrapItemRepository faAssetScrapItemRepository;




    /**
     * 根据卡片id查全部
     */
    public List<FaAssetScrapItem> findCard(SimpleRequest request){

        String id = request.get("id");
//        List<FaAssetScrapItem> faAssetScrapItems = faAssetScrapItemRepository.findCard(id);
        List<FaAssetScrapItem> faAssetScrapItems = faAssetScrapItemRepository.findAll(JpaDsl.toCriteriaByEq("faCard.id",id));
        return faAssetScrapItems;

    }

}
